<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>抓阄程序</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #f4f4f4;
        }
        .container {
            text-align: center;
        }
        button {
            padding: 10px 20px;
            font-size: 16px;
            margin-top: 20px;
            cursor: pointer;
        }
        #result {
            font-size: 24px;
            font-weight: bold;
            color: green;
            margin-top: 20px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>抓阄程序</h1>
        <button onclick="drawLots()">抓阄</button>
        <div id="result"></div>
    </div>

    <script>
        function drawLots() {
            var participants = ["号码1", "号码2", "号码3", "号码4", "号码5"]; // 参与者列表
            var resultContainer = document.getElementById("result");

            if (participants.length === 0) {
                resultContainer.textContent = "参与者列表为空，无法进行抓阄。";
                return;
            }

            // 随机选择一个号码
            var randomIndex = Math.floor(Math.random() * participants.length);
            var winner = participants[randomIndex];

            // 在页面上显示抓阄结果
            resultContainer.textContent = "抓阄结果：" + winner;
        }
    </script>
</body>
</html>
